<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>欢迎登录后台管理系统</title>
<link href="<%=request.getContextPath()%>/static/common/plugin/Uimaker/css/style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="<%=request.getContextPath()%>/static/common/plugin/Uimaker/js/jquery.js"></script>
<script src="<%=request.getContextPath()%>/static/common/plugin/Uimaker/js/cloud.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/static/common/jquery.min.js"></script>
<script language="javascript">
	$(function(){
    $('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
	$(window).resize(function(){  
    $('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
    })  
});  
</script> 
<style >
.images{
width: 100px;
height: 48px;
position: absolute;
bottom:80px;
right: 160px;
}
.tilte{
position: absolute;
bottom:80px;
right: 16px;
}





</style>
</head>

<body style="background-color:#1c77ac; background-image:url(<%=request.getContextPath()%>/static/common/plugin/Uimaker/images/light.png); background-repeat:no-repeat; background-position:center top; overflow:hidden;">


    <div id="mainBody">
      <div id="cloud1" class="cloud"></div>
      <div id="cloud2" class="cloud"></div>
    </div>  


<div class="logintop">    
    <span>欢迎登录后台管理界面平台</span>    
    <ul>
    <li><a href="<%=request.getContextPath()%>/index.jsp">回首页</a></li>
    <li><a href="#">帮助</a></li>
    <li><a href="#">关于</a></li>
    </ul>    
    </div>
    <div class="loginbody">
    <c:if test="${!empty loginfail || !empty sessionClosed}">
			
		      <strong>${loginfail }</strong>
		    
	    </c:if>
	    <c:if test="${!empty valate}">
			
		      <strong>${valate }</strong>
		    
	    </c:if>
    <span class="systemlogo"></span> 
       
    <div class="loginbox">
   <form action="<%=request.getContextPath()%>/TalentServlet?command=get" method="post" >
    <ul>
   <c:if test="${!empty loginfail}">
			
		       <li ><input name="code" type="text" class="loginuser"  value="${code }"/>
		    
	    </c:if>
	     <c:if test="${empty loginfail}">
			
		     <li ><input name="code" type="text" class="loginuser"  value="${cookie.code.value }"/></li>
		    
	    </c:if>
 
    
    <li ><input name="password" type="password" class="loginpwd" value="${cookie.password.value }" /></li>
    <c:if test="${failcount >2}">
   <div><li ><input name="valate" type="text" class="loginuse" id="valate" /></li><img alt="验证码" src="<%=request.getContextPath()%>/kaptcha.jpg" id="imges" class="images" onclick="changeimg()"/><span id="tilte" class="tilte"></span></div>
   
   </c:if>
  <li ><input name="login" type="submit" class="loginbtn" value="登录" id="fromsub"/><label><input name="remberinfo" type="checkbox" value="true" id="remberinfo" />记住密码</label><label><a href="#">忘记密码？</a></label></li>
    <script>
     var remberinfo='${cookie.remberinfo.value }';
     console.info(remberinfo);
     var remberinfos=document.getElementById("remberinfo").value;
     console.info(remberinfos);
     if(remberinfo==remberinfos){
    	 document.getElementById("remberinfo").checked=true;
     }
     function changeimg(){
    		var img=document.getElementById("imges");
    		img.src='<%=request.getContextPath()%>/kaptcha.jpg?date='+new Date().getTime(); 	

    	}
    
    </script>
    
    </ul>
    </form>
    <script>
    //验证码ajax
    $("#valate").blur(function(){
    	$.get("<%=request.getContextPath()%>/TalentServlet",{command:"check",imagevalue:$("#valate").val(),date:new Date().getTime() },function(data){
    		var fromsbu=document.getElementById("fromsub");
    		if(data==1){
    			$("#tilte").html('验证码不正确，请重新输入');
    			$("#fromsub").attr("disabled","disabled");
    		}
    		else{
    			$("#tilte").html('');
    			$("#fromsub").removeAttr("disabled");
    		}
    	});	
    } );
    </script>
    
    </div>
    
    </div>
  
    
    
    
   
	
    
</body>

</html>